]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
notificationDamon: Always send the activation token
authorMarco Trevisan (Treviño) <mail@3v1n0.net>
Fri, 26 Sep 2025 04:29:16 +0000 (06:29 +0200)
committerMarge Bot <marge-bot@gnome.org>
Fri, 26 Sep 2025 15:00:29 +0000 (15:00 +0000)
In case of FDO notifications, we may receive a notification coming from
non-desktop-applications (e.g. gsd does that), but in any case when
activating an action we should always provide back the activation-token.

So send the startup notification ID in any case, even if the appId is
unset (in fact get_startup_notify_id() uses a nullable parameter for a
reason since GNOME/glib@6210708f).

In wayland this more than enough, while in X11 we could have used the
gnome-shell desktop file as fallback, but that's gone for good now!

Fixes: bb73bf5
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3891>

js/ui/notificationDaemon.js

index 07ef7be610ab2f586d810e841074e732becec34d..00a3dbcdbcb96503739222ef10cf95469f81316d 100644 (file)
@@ -304,12 +304,10 @@ class FdoNotificationDaemon {
 
     _emitActivationToken(source, id) {
         const context = global.create_app_launch_context(0, -1);
-        const info = source.app?.get_app_info();
-        if (info) {
-            const token = context.get_startup_notify_id(info, []);
-            this._dbusImpl.emit_signal('ActivationToken',
-                GLib.Variant.new('(us)', [id, token]));
-        }
+        const appInfo = source.app?.get_app_info() ?? null;
+        const token = context.get_startup_notify_id(appInfo, []);
+        this._dbusImpl.emit_signal('ActivationToken',
+            GLib.Variant.new('(us)', [id, token]));
     }
 }